In the past, some imaging device includes a defect correcting unit for correcting a defective portion (hereinafter referred to as “defect” as appropriate) of a digital image signal generated by a pixel that does not normally function. As defect correction known in general, there is a method of storing a position of a defect, for example, at the time of product shipment and interpolating information of peripheral pixels with respect to a target pixel as a target of the defect correction (static correction). In the static correction, a defect caused by a pixel that does not completely function can be corrected. On the other hand, it is difficult to correct a defect, a form of which changes according to conditions such as temperature and an analog gain. To correct such a defect, a technique for checking presence or absence of a defect during the operation of an imaging device and correcting a detected defect (dynamic correction) is proposed.
Some imaging device includes a noise-reduction processing unit for reducing noise such as random noise. When dedicated line memories are respectively provided in the defect correcting unit and the noise-reduction processing unit, a circuit size increases. When a common line memory is provided to feed back a result of the defect correction to the noise-reduction processing unit, if a wrong determination is made in the defect correcting unit, it is anticipated that image quality is deteriorated because noise reduction processing for several pixels after the wrong determination is affected. When the defect correction and the noise reduction are performed as parallel processing, a noise reduction effect is not obtained for pixels subjected to the defect correction.
Therefore, in the past, a technique for switching, according to a difference between a maximum and a minimum of signal values of a target pixel and peripheral pixels, correction values to be adopted for the target pixel is proposed (see, for example, Japanese Patent Laid-Open No. 2008-258909). As the correction values, for example, an average or a median of the signal values of the target pixel and the peripheral pixels or a value closest to the maximum or the minimum among the signal values is adopted. In this case, when an analog gain is set high because illuminance is low, in some case, because the influence of noise is intensified, the noise tends to be determined as a defect and the noise reduction effect is weakened. Depending on an output balance in the peripheral pixels, a shift occurs in the correction value and image quality is deteriorated.